﻿@page "/keywords"
@inherits BaseKeywordPage

<PageContainer Title="Keywords" PageTitle="@Title">
    <Breadcrumb>
        <Breadcrumb>
            <BreadcrumbItem>
                <a href="">
                    <MdiIcon Type="@IconNames.Home" />
                    <span>Home</span>
                </a>
            </BreadcrumbItem>
            <BreadcrumbItem>
                <span>
                    <MdiIcon Type="@IconNames.Keywords" />
                    <span>Keywords</span>
                </span>
            </BreadcrumbItem>
        </Breadcrumb>
    </Breadcrumb>
    <ChildContent>
        <Loader OnLoad="@OnLoad" @ref="loader">
            <div>
                @foreach (var v in Data.Items)
                {
                    <Tag Class="m-1">
                        <a class="m-1" style="font-size: 18px" href="@UrlGenerator.Keyword(v)">@v.OneNameOrDefault()</a>
                    </Tag>
                }
            </div>
        </Loader>
    </ChildContent>
</PageContainer>

@code {
    private KeywordCollection Data;

    private Loader loader;

    private async Task OnLoad()
    {
        Data = await Service.PostService.GetKeywords();
    }
}
